home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 501-525 / disk_503 / pcq / pcq12a.lzh / Examples / Icons.p < prev    next >
Text File  |  1991-04-18  |  819b  |  32 lines

  1. program Icons;
  2.  
  3. {
  4.   This program shows how to access the arguments passed to a program
  5.   by the Workbench.  Compile and link this program, then make a
  6.   tool icon for it.  Then activate the program by clicking on some
  7.   project icons and this icon.  In my original archive, I included
  8.   a copy of the CLI icon in this directory, so you might be able to
  9.   use it.
  10.  
  11.   This program also shows that PCQ will open a default console window
  12.   if a program run from the Workbench needs it.
  13. }
  14.  
  15. {$I "Include:Utils/Parameters.i"}
  16.  
  17. var
  18.    WB : WBStartupPtr;
  19.  
  20.    Arg : Integer;
  21. begin
  22.     WB := GetStartupMsg();
  23.     if WB <> nil then begin
  24.     Writeln('There were ', WB^.sm_NumArgs, ' arguments.');
  25.     for Arg := 1 to WB^.sm_NumArgs do
  26.         writeln(WB^.sm_ArgList^[Arg].wa_Name);
  27.     readln;
  28.     end else
  29.     writeln('Run from the CLI');
  30. end.
  31.  
  32.